//
//  UILabel+Extension.m
//  weibo110
//
//  Created by 臧松 on 15/12/26.
//  Copyright © 2015年 臧松. All rights reserved.
//

#import "UILabel+Extension.h"

@implementation UILabel (Extension)
+(instancetype)labelWithTitle:(NSString *)title fontSize:(CGFloat)fontSize color:(UIColor *)color screenInset:(CGFloat)screenInset{
    UILabel *lbl = [[UILabel alloc]init];
    lbl.text = title;
    lbl.textColor = color;
    lbl.font = [UIFont systemFontOfSize:fontSize];
    lbl.numberOfLines = 0;
    if (screenInset == 0) {
        
        lbl.textAlignment = NSTextAlignmentCenter;
    }else{
        lbl.preferredMaxLayoutWidth = [UIScreen mainScreen].bounds.size.width - 2*screenInset;
        lbl.textAlignment = NSTextAlignmentLeft;
    }
    return lbl;

}
@end
